/* 
 * File:   SceneManager.cpp
 * Author: Pie
 * 
 * Created on April 25, 2011, 3:13 PM
 */
#include <fstream>

#include "SceneManager.h"
#include "Scene.h"

SceneManager::SceneManager() {
}

SceneManager::~SceneManager() {
}


void SceneManager::loadModel(const string& file, const string& out) {
    const aiScene* scene = _importer.ReadFile(file, aiProcessPreset_TargetRealtime_Quality);

    if (!scene) {
        return;
    }
    SceneModel* obj_scene = new SceneModel(scene);
    SceneNode* node = new SceneNode();
    node->load(obj_scene);
    _importer.FreeScene();
    
    //Write out the scene node
    node->write(out);
    
    //delete
    delete node;
}